package com.af.security.auth.user.detail;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author : zhenyun.su
 * @since : 2019/1/24
 * @Comment: 身份认证成功后，用户授权的菜单
		id    菜单ID，也是权限ID
        pid   菜单父节点ID，根节点为 0
		text  菜单名称,
		i18n  多语言标识,
		group true 目录，false 使用链接的菜单,
		link  内部链接,
		externalLink  外部链接,
		target  链接打开的页面显示的目标,  _blank, _self, _parent, _top
		icon  菜单图标,
		badge  徽标数，展示的数字，默认红色
		shortcut 快捷菜单，
		shortcutRoot 快捷菜单根节点，
		sort   菜单排序,
		operation_ids 功能点id列表, 例如1,2,3,
		hide 隐藏菜单
		disabled  禁用菜单
		sort 菜单排序，在同一个pid下
		List<AuthMenu> children 子菜单，正常支持3层

 该菜单定义，参考： https://ng-alain.com/theme/menu/zh#Menu
 */

public class AuthMenu implements Serializable{
	private static final long serialVersionUID = -4007007557417307206L;
	@JsonIgnore
	private Long id;
	@JsonIgnore
	private Long pid;
	private String text;
	private String i18n;
	private Boolean group;
	private String link;
	private String externalLink;
	private String target;
	private String icon;
	private Integer badge;
	private Boolean shortcut;
	private Boolean shortcutRoot;
	@JsonIgnore
	private Integer sort ;
	private Boolean hide;
	private Boolean disabled ;
    private List<AuthMenu> children = new ArrayList<>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}

	public Boolean getGroup() {
		return group;
	}

	public void setGroup(Boolean group) {
		this.group = group;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getExternalLink() {
		return externalLink;
	}

	public void setExternalLink(String externalLink) {
		this.externalLink = externalLink;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Integer getBadge() {
		return badge;
	}

	public void setBadge(Integer badge) {
		this.badge = badge;
	}

	public Boolean getShortcut() {
		return shortcut;
	}

	public void setShortcut(Boolean shortcut) {
		this.shortcut = shortcut;
	}

	public Boolean getShortcutRoot() {
		return shortcutRoot;
	}

	public void setShortcutRoot(Boolean shortcutRoot) {
		this.shortcutRoot = shortcutRoot;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public Boolean getHide() {
		return hide;
	}

	public void setHide(Boolean hide) {
		this.hide = hide;
	}

	public Boolean getDisabled() {
		return disabled;
	}

	public void setDisabled(Boolean disabled) {
		this.disabled = disabled;
	}

	public List<AuthMenu> getChildren() {
		return children;
	}

	public void setChildren(List<AuthMenu> children) {
		this.children = children;
	}

	@Override
	public String toString() {
		return "AuthMenu{" +
				"id=" + id +
				", pid=" + pid +
				", text='" + text + '\'' +
				", i18n='" + i18n + '\'' +
				", group=" + group +
				", link='" + link + '\'' +
				", externalLink='" + externalLink + '\'' +
				", target='" + target + '\'' +
				", icon='" + icon + '\'' +
				", badge=" + badge +
				", shortcut=" + shortcut +
				", shortcutRoot=" + shortcutRoot +
				", sort=" + sort +
				", hide=" + hide +
				", disabled=" + disabled +
				", children=" + children +
				'}';
	}
}
